﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Web.API.IBLL;
using Web.API.Model;

namespace Web.API.UI.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class MemberController : ControllerBase,MemberIBLL
    {
        public MemberController(MemberIBLL bll) 
        {
            Bll = bll;
        }
        public MemberIBLL Bll { get;}
        [HttpPost("AddMember")]
        public Task<int> AddMember(MemberModel member)
        {
           return Bll.AddMember(member);
        }
        [HttpGet("Fantian")]
        public MemberModel Fantian(int id)
        {
           return Bll.Fantian(id);
        }
        [HttpGet("GetMember")]
        public dynamic GetMember(string? name, int index, int size)
        {
           return Bll.GetMember(name, index, size);
        }
    }
}
